<?php

namespace app\index\model;

use Firebase\JWT\JWT;
use think\Db;
use think\db\Query;
use think\facade\Request;
use think\facade\Session;
use think\Model;
class Edit extends Model
{
    function updata(){
        $a = Session::get("user");
        $id=$a['id'];
        $input = input();
        $validate = new \app\index\validate\Edit();
        if(!$validate->check($input)){
            throw new \Exception($validate->getError());
            return;
        }
        $data = Request::only(['name','password','phone','address']);
        Db::name('user')->where('id',$id)->update($data);
        return;
    }
}
